import java.util.Scanner;

public class Demo {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int[] p1 = new int[2];
        for (int i = 0; i < p1.length; i++) {
            p1[i] = sc.nextInt();
        }

        long[] p2 = new long[p1[0]];
        for (int i = 0; i < p2.length; i++) {
            p2[i] = sc.nextLong();
        }

//        for (int x : p1) {
//            System.out.print(x + " ");
//        }
//        System.out.println();
//        for (int x : p2) {
//            System.out.print(x + " ");
//        }


        long k = p1[1];
        for (int i = 0; i < p2.length; i++) {
            if (k >= p2[i]) {
                k += p2[i];
            } else {
                k += gcd(k, p2[i]);
            }
        }

        System.out.println(k);

    }

    public static long gcd(long a, long b) {
        while (b != 0) {
            long temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }
}
